/* tabmap.h */

#ifndef _TABMAP_H
#define _TABMAP_H

#define TAB_WIDTH	8
#define MAP_CAP		2

typedef struct tabmap {
	int *map;
	int len;
	int cap;
} tabmap_t;

tabmap_t * tabmap_new();

tabmap_t * tabmap_get_tabmap(char * str);

int tabmap_get_actual_offset(tabmap_t *tmap, int logical_offset);

int tabmap_get_actual_len(tabmap_t *tmap);

int tabmap_get_logical_offset(tabmap_t *tmap, int actual_offset);

int tabmap_get_logical_shift(tabmap_t *tmap, int logical_offset, int actual_shift);


int tabmap_insert_char(tabmap_t *tmap, int ch, int logical_offset);

int tabmap_delete_char(tabmap_t *tmap, int logical_offset);

int tabmamp_insert_tab(tabmap_t *tmap, int logical_offset);

int tabmap_insert_str(tabmap_t *tmap, int pos, char *str);

int tabmap_delete_str(tabmap_t *tmap, int from, int to);

tabmap_t * tabmap_copy_tabmap(tabmap_t *tmap);

#endif /* _TABMAP_H */
